# Maintainer: Antonio Rojas <arojas@archlinux.org>

pkgname=plasma5-applets-window-buttons
pkgver=0.11.1
pkgrel=2
pkgdesc='Plasma 5 applet in order to show window buttons in your panels'
arch=(loong64 x86_64)
url='https://github.com/psifidotos/applet-window-buttons'
license=(GPL)
depends=(plasma-workspace)
makedepends=(extra-cmake-modules)
conflicts=(libappletdecoration)
replaces=(libappletdecoration)
source=(https://github.com/psifidotos/applet-window-buttons/archive/$pkgver/$pkgname-$pkgver.tar.gz
        https://github.com/psifidotos/applet-window-buttons/commit/924994e1.patch)
sha256sums=('0588a3bba77206766549139b4bee1a08b7be7a7113e658f746709b9ee4d3017a'
            'db8740b25036e5dd8b4b17375bea9871e49634b6fcde1b4cc3fb54e911ac789d')

prepare() {
  patch -d applet-window-buttons-$pkgver -p1 < 924994e1.patch # Support Plasma 5.27
}

build() {
  cmake -B build -S applet-window-buttons-$pkgver
  cmake --build build
}

package() {
  DESTDIR="$pkgdir" cmake --install build
}
